package application.translators.impl;

import application.model.TypeModel;
import application.model.TypesModel;
import application.translators.Translator;
import mappings.Types;

import java.util.List;

public class TypesTranslator implements Translator<List<Types>, TypesModel>
{
    @Override
    public TypesModel translate(List<Types> input)
    {
        TypesModel typesModel = new TypesModel();

        for(Types type : input)
        {
            TypeModel typeModel = new TypeModel();

            typeModel.setName(type.getName());
            typeModel.setId(type.getId());

            typesModel.addType(typeModel);
        }

        return typesModel;
    }
}
